package com.situ.mall.controller;

import com.situ.mall.pojo.Shipping;
import com.situ.mall.pojo.User;
import com.situ.mall.service.IShippingService;
import com.situ.mall.util.Result;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import javax.servlet.http.HttpSession;

@Controller
@RequestMapping("/shipping")
public class ShippingController {
    @Autowired
    private IShippingService shippingService;

    @RequestMapping("/insert")
    @ResponseBody
    public Result insert(Shipping shipping) {
        boolean isSuccess = shippingService.insert(shipping);
        return isSuccess ? Result.ok("添加成功") : Result.error("添加失败");
    }
}
